package com.itheima.Homework5;

public class Test11 {
    public static void main(String[] args) {
        int arr[] = {1, 3, 2,};
        int arr1[] = {3, 2, 1};
        compare1(arr1, arr);
    }

    public static boolean compare(int[] arr, int[] arr1) {
        if (arr.length != arr1.length) {
            return false;
        } else {
            int count = 0;
            for (int i = 0; i < arr.length; i++) {
                for (int j = 0; j < arr1.length; j++) {
                    if (arr[i] != arr1[j]) {
                        count = j;
                    } else {
                        break;
                    }
                }
                if (count == arr1.length - 1) {
                    return false;

                }
                if (i == arr.length - 1) {
                    return true;
                }
            }
        }
        return false;
    }

    public static void compare1(int[] arr, int[] arr1) {
        if (compare(arr, arr1) && compare(arr1, arr)) {
            System.out.println("数组数据相同");
        } else {
            System.out.println("数组数据不同");
        }
    }

}
